package name.sraynal.coodiary.file.analyzer;

import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.Set;

import name.sraynal.coodiary.fileprovider.IConfigProvider;
import name.sraynal.coodiary.storage.Quote;

public abstract class ClassicFileAnalyzer implements IFileAnalyzer {

	private IConfigProvider configProvider;
	
	protected IConfigProvider getConfigProvider() {
		return configProvider;
	}

	public ClassicFileAnalyzer(IConfigProvider configProvider) {
		super();
		this.configProvider = configProvider;
	}

	@Override
	public abstract Set<Quote> analyze(File input) throws IOException;

	@Override
	public abstract Set<Quote> analyze(List<File> inputs) throws IOException;

	@Override
	public abstract Set<Quote> getQuotes();

	@Override
	public abstract void setInput(File input);

	public String getCorrepondingType(String inType) {
		String lowInType = inType.toLowerCase();
		return this.configProvider.getTypeMappings().get(lowInType);
	}
//		String result = N_A;
//		
//		if ("a".equals(lowInType)) {
//			result = ASSURER;
//		} else if ("ba".equals(lowInType)) {
//			result = BADMINTON;
//		} else if ("b".equals(lowInType)||"be".equals(lowInType)) {
//			result = BIEN_ETRE;
//		} else if ("d".equals(lowInType)) {
//			result = DANSE;
//		} else if ("e".equals(lowInType)||"ex".equals(lowInType)) {
//			result = EXCEPTIONNEL;
//		} else if ("f".equals(lowInType)||"fo".equals(lowInType)) {
//			result = FONDATEUR;
//		} else if ("h".equals(lowInType)) {
//			result = HISTOIRE;
//		} else if ("hs".equals(lowInType)||("hi".equals(lowInType))) {
//			result = HISTOIRES;
//		} else if ("i".equals(lowInType)) {
//			result = INFORMATIC;
//		} else if ("l".equals(lowInType)) {
//			result = LECTURES;
//		} else if ("au".equals(lowInType)) {
//			result = LES_AUTRES;
//		} else if ("n".equals(lowInType)) {
//			result = NANAS;
//		} else if ("r".equals(lowInType)) {
//			result = REALITE;
//		} else if ("ru".equals(lowInType)) {
//			result = RUGBY;
//		} else if ("t".equals(lowInType)||"tr".equals(lowInType)) {
//			result = TRAVAIL;
//		} else if ("te".equals(lowInType)) {
//			result = TENNIS;
//		} else if ("ad".equals(lowInType)) {
//			result = ADULTE;
//		} else if ("m".equals(lowInType)) {
//			result = MOI;
//		} else if ("mo".equals(lowInType)) {
//			result = MOTS;
//		} else if ("q".equals(lowInType)) {
//			result = QUESTIONS;
//		} else if ("to".equals(lowInType)) {
//			result = TODOS;
//		} else if ("tlt".equals(lowInType)) {
//			result = TOUT_LE_TEMPS;
//		} else if ("ro".equals(lowInType)) {
//			result = ROMAN;
//		} else if ("sx".equals(lowInType)||"se".equals(lowInType)) {
//			result = SEXE;
//		} else if ("mu".equals(lowInType)) {
//			result = MUSIQUE;
//		} else if ("ec".equals(lowInType)) {
//			result = ECONOMIE;
//		} else if ("ma".equals(lowInType)) {
//			result = MANTRAS;
//		} else if ("co".equals(lowInType)) {
//			result = COUPLE;
//		} else if ("lc".equals(lowInType)) {
//			result = LANGAGE_CORPOREL;
//		} else if ("ch".equals(lowInType)) {
//			result = CHALLENGE;
//		} else if ("ada".equals(lowInType)) {
//			result = ADAGES;
//		} else if ("so".equals(lowInType)) {
//			result = SOUVENIRS;
//		} else if ("sp".equals(lowInType)) {
//			result = SPORT;
//		}
//		return result;
//	}

}
